Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

sceNpTrophy: Fix sceNpTrophyRegisterContext for handler abortion #9586

Merged
merged 1 commit into from
Jan 12, 2021

Conversation

elad335
Copy link
Contributor

@elad335 elad335 commented Jan 11, 2021

Emulation Features

  • Implement handler abortion during context registeration.

Bugfixes

  • Fixed recursive calls to sceNpTrophy functions by callback from registering context.
  • Turns out the reader lock for context registeration was incorrect because ctxt->tropusr and trophy directory are being modified. made it an exclusive lock after callback.

Fixes #9415

@elad335 elad335 changed the title sceNpTrophy: Reimplement sceNpTrophyAbortHandle for context registartion sceNpTrophy: Reimplement sceNpTrophyAbortHandle for context registertion Jan 11, 2021
@elad335 elad335 changed the title sceNpTrophy: Reimplement sceNpTrophyAbortHandle for context registertion sceNpTrophy: Reimplement sceNpTrophyAbortHandle for context registeration Jan 11, 2021
@Nekotekina
Copy link
Member

Using recursive mutex is considered a bad practice. Did you think of better workarounds?

@elad335
Copy link
Contributor Author

elad335 commented Jan 12, 2021

A small hack can be made so it reruns all error checks and calls get_context_ex twice before and after first callback including the INITIALIZED check. (with unlock, callback(), relock mutex) Who knows maybe fw does something similar as well.
If you agree of course.

@Nekotekina
Copy link
Member

Nekotekina commented Jan 12, 2021

Well, typical workflow with normal mutex is lock - update - unlock, where update doubtfully allows some arbitrary code such as a callback to execute. Something like relocking after callback seems more sound.

@elad335
Copy link
Contributor Author

elad335 commented Jan 12, 2021

Done.

@elad335 elad335 force-pushed the patch-14 branch 2 times, most recently from 30f8af5 to 0846938 Compare January 12, 2021 14:50
@elad335
Copy link
Contributor Author

elad335 commented Jan 12, 2021

  • Turns out the reader lock for this function was incorrect because ctxt->tropusr and trophy directory is being modified. made it an exclusive lock after callback.

@elad335 elad335 force-pushed the patch-14 branch 2 times, most recently from 262d5c4 to 1cc8dee Compare January 12, 2021 14:59
@Nekotekina Nekotekina changed the title sceNpTrophy: Reimplement sceNpTrophyAbortHandle for context registeration sceNpTrophy: Reimplement sceNpTrophyAbortHandle for context registration Jan 12, 2021
@Nekotekina
Copy link
Member

Wait a second, this is not sceNpTrophyAbortHandle right?

@Nekotekina Nekotekina changed the title sceNpTrophy: Reimplement sceNpTrophyAbortHandle for context registration sceNpTrophy: Fix sceNpTrophyRegisterContext for context registration Jan 12, 2021
* Implement handler abortion during context registeration.
* Fixed recursive calls to sceNpTrophy functions such as by callbacks from registering context.
* Turns out the reader lock for context registeration was incorrect because ctxt->tropusr and trophy directory are being modified. made it an exclusive lock after callback.
@elad335 elad335 changed the title sceNpTrophy: Fix sceNpTrophyRegisterContext for context registration sceNpTrophy: Fix sceNpTrophyRegisterContext for handler abortion Jan 12, 2021
@Nekotekina Nekotekina merged commit e1f95ce into RPCS3:master Jan 12, 2021
@jokoputera
Copy link

this one fixed the Splinter Cell Trilogy stuck at intro

@elad335 elad335 deleted the patch-14 branch February 12, 2021 10:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Regression: Implemented Trophy cause Splinter Cell Trilogy HD stuck at Intro
4 participants